import http from '../utils/http.js'

const ASSET_SERV_URL = process.env.ASSET_SERV_URL
const PREFIX_REST_PATH = 'api/assetcenter/prodinsts'

const prodInstApi = {
  // 添加
  addProdInst (params, success, error) {
    http.post(ASSET_SERV_URL + PREFIX_REST_PATH, {params, success, error})
  },
  // 修改
  updateProdInst (params, success, error) {
    http.put(ASSET_SERV_URL + PREFIX_REST_PATH + '/' + params.prodInstId, {params, success, error})
  },
  // 删除
  delProdInst (params, success, error) {
    http.delete(ASSET_SERV_URL + PREFIX_REST_PATH + '/' + params, {params, success, error})
  },
  // 分页查询
  queryProdInstPage (params, success, error) {
    http.get(ASSET_SERV_URL + PREFIX_REST_PATH + '/page', {params, success, error})
  },
  // 列表查询
  queryProdInsts (params, success, error) {
    http.get(ASSET_SERV_URL + PREFIX_REST_PATH, {params, success, error})
  },
  // 单个对象获取
  getProdInst (params, success, error) {
    http.get(ASSET_SERV_URL + PREFIX_REST_PATH + '/' + params.prodInstId, {params, success, error})
  }
}
export default prodInstApi
